package com.googlecode.cswish.struts.hibernate;

import javax.annotation.Resource;

import org.hibernate.cfg.Configuration;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
import org.springframework.stereotype.Service;

/**
 * Get the hibernate configuration
 * 
 * @author Jerry.Feng Date: 2008-10-14
 */
@Service
public class JPASessionFactoryBean {
	@Resource
	private LocalSessionFactoryBean sessionFactoryBean;
	
	public Configuration getConfiguration() {
		if (sessionFactoryBean != null) {
			return sessionFactoryBean.getConfiguration();
		} else {
			return null;
		}
	}
}
